<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class UserFeedback extends Model
{
    const CREATED_AT = 'insert_time';
    /**
     * 与模型关联的数据表。
     *
     * @var string
     */
    protected $table = 'lexiang_opinion';

    protected $primaryKey = 'opinion_id';

    public $timestamps = false;

    public function getList($page=20)
    {
    	return UserFeedback::where('lexiang_opinion.action_status','>=','0')
    	->leftJoin('lexiang_user','lexiang_opinion.users_id','=','lexiang_user.user_id')
    	->orderBy('lexiang_opinion.insert_time','desc')
    	->select('lexiang_opinion.*','lexiang_user.nicename')
    	->paginate($page);
    }
}
